home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cpptutor.arc / BOXES2.CPP < prev    next >
Text File  |  1991-04-28  |  692b  |  28 lines

  1.                                  // Chapter 5 - Program 9
  2. #include "iostream.h"
  3. #include "box.hpp"
  4.  
  5. main()
  6. {
  7. box small, medium, large;          //Three boxes to work with
  8.  
  9.    small.set(5, 7);
  10.                           // Note that the medium box uses the values
  11.                           // supplied by the constructor
  12.    large.set(15, 20);
  13.    
  14.    cout << "The small box area is " << small.get_area() << "\n";
  15.    cout << "The medium box area is " << medium.get_area() << "\n";
  16.    cout << "The large box area is " << large.get_area() << "\n";
  17.    
  18. }
  19.  
  20.  
  21.  
  22.  
  23. // Result of execution
  24. //
  25. // The small box area is 35
  26. // The medium box area is 64
  27. // The large box area is 300
  28.